﻿<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <title>kongtou</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link href="css/style.css" rel="stylesheet" />
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="js/jquery-3.3.1.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

    <script type="text/javascript">
        var server = "http://localhost:13772";
        //var server = "https://www.jsonfree.com/mgxapi";
        $(function () {

            var model = {
                "token": "60623432-5a5b-4bf6-90f8-120484bcf283",
                "projectID": "15FC23A1-65E9-4345-966A-E9E5BEEFE097",
                "cstid": "176E696E-C95E-42CC-9202-E157A91F1088",
            };
            $.ajax({
                url: "http://localhost:8081/FHYAPiTest/FengHuangYun/SalesTools/LeavePhone/GetIsSaler",
                type: "POST",
                data: JSON.stringify(model),
                success: function (data) {
                    debugger
                    alert(JSON.stringify(data))
                }
            });

            return;



            $("#bitImg").click(function () {
                copyGFAddress();
            });

            $("#submit").click(function () {
                submit();
            });

            $('input[type=radio][name=addrRadio]').change(function () {
                switch (this.value) {
                    case "BTC":
                        $("#guanfangAddress").html("36EvU99jZXFEYyE1tFgrghrZGvsevA4UmB");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    case "ETH":
                        $("#guanfangAddress").html("0x2fF77bd9db2992eC21C368A2236F0f44BE34d183");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    case "BNB":
                        $("#guanfangAddress").html("0x2fF77bd9db2992eC21C368A2236F0f44BE34d183");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    case "Xdag":
                        $("#guanfangAddress").html("+hkDQU0eqV3MRz8DjrZEW6TCqfiUGBn6");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    case "Doge":
                        $("#guanfangAddress").html("DQfcHMnZs71vLhMh1f1Kd9293kJfxRHFjy");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    case "Ht":
                        $("#guanfangAddress").html("0x2fF77bd9db2992eC21C368A2236F0f44BE34d183");
                        document.getElementById('bitImg').src = 'img/copy-address.jpg';
                        break;
                    default:
                }

            });
        });

        //复制内容到剪切板
        function copyGFAddress() {
            var gfAddress = "";
            var addressType = $(".bitRadio input:radio[name='addrRadio']:checked").val();
            switch (addressType) {
                case "BTC":
                    gfAddress = "36EvU99jZXFEYyE1tFgrghrZGvsevA4UmB"
                    break;
                case "ETH":
                    gfAddress = "0x2fF77bd9db2992eC21C368A2236F0f44BE34d183"
                    break;
                case "BNB":
                    gfAddress = "0x2fF77bd9db2992eC21C368A2236F0f44BE34d183"
                    break;
                case "Xdag":
                    gfAddress = "+hkDQU0eqV3MRz8DjrZEW6TCqfiUGBn6"
                    break;
                case "Doge":
                    gfAddress = "DQfcHMnZs71vLhMh1f1Kd9293kJfxRHFjy"
                    break;
                case "Ht":
                    gfAddress = "0x2fF77bd9db2992eC21C368A2236F0f44BE34d183"
                    break;
                default:
            }
            if (addressType) {
                var element = $("<textarea>" + gfAddress + "</textarea>");
                $("body").append(element);
                element[0].select();
                document.execCommand("Copy");
                element.remove();
                //alert(gfAddress + "，您已复制官方" + addressType + "钱包地址到剪切板，请向它转不小于0.00001个" + addressType +"，并进行下一步操作");
                alert(gfAddress + "，You have copied the official " + addressType + " wallet address to the clipboard. Please turn to it no less than 0.00001 " + addressType + " and proceed with the next step.");
            }
            else {
                //请选择币种
                alert("Choose coin");
            }
        }

        function submit() {
            if (!checkRadio()) {
                //请选择币种
                alert("Choose coin！");
                return false;
            }
            var addressType = $(".bitRadio input:radio[name='addrRadio']:checked").val();
            var addressVal = $("#addressStr").val();
            var uid = $("#uid").val();
            /*
            if (!addressVal) {
                //alert("请填写币种地址");
                alert("Type Your Wallet Address");
                return false;
            }

            if (addressVal.length < 30) {
                //alert("请检查钱包地址格式是否正确");
                alert("Please make sure your wallet address is valid");
                return false;
            }

            if (!uid) {
                //alert("请填写UID");
                alert("Type Your PiEXGO UID");
                return false;
            }

            if (uid.length != 5 && uid.length != 9) {
                //alert("请输入正确UID，5位或者9位");
                alert("Please enter the correct UID, 5 or 9 bits.");
                return false;
            }*/

            $.ajax({
                url: server + "/api/KongTou/AddKongTou",
                type: "POST",
                dataType: "json",
                data: {
                    "Source": "10",
                    "Token": "",
                    "UserID": "",
                    "PxgID": uid,
                    "AddressType": addressType,
                    "BitAddress": addressVal,
                    //"BTCAddress": addressVal,
                    //"ETHAddress": addressVal
                },
                //error: function (XmlHttpRequest, textStatus, errorThrown) { alert(XmlHttpRequest.responseText); },
                success: function (data) {
                    //提交成功
                    if (data && data.Code == 0) {
                        alert("Successful submission");
                        $("#addressStr").val("");
                        $("#uid").val("");
                    }
                    else {
                        //提交失败
                        alert("Submission failure，" + data.Msg);
                    }
                }
            });
        }

        function checkRadio() {
            var count = 0;
            var type = "";
            var radios = document.getElementsByName("addrRadio");
            for (i = 0; i < radios.length; i++) {
                if (radios[i].type == "radio") {
                    if (radios[i].checked) {
                        count++;
                        type = $(radios[i]).val();
                    }
                }
            }
            if (count <= 0) {
                return false;
            }
            else {
                return true;
            }
            return false;
        }

    </script>
</head>
   <body>
      <div class="col-sm-6"></div>
      <div id="grad1">
          <h1 class="text-center"><img src="img/smartx@2x.png" alt="" class="img_logo"></h1>
          <ul class="nav justify-content-center ul_margin">
              <li class="nav-item">
              <li class="nav-item">
                  <a class="nav-link SmartW active" target="_blank" href="https://www.smartx.one/Whitepaper.pdf" tabindex="-1" aria-disabled="true">White Paper</a>
              <li class="nav-item">
                  <a class="nav-link SmartC" href="mailto:social@smartx.one">Contact</a>
              </li>
              <li class="nav-item">
                  <a class="nav-link SmartD" target="_blank" href="https://discord.gg/JymqJyS">Discord</a>
              </li>
              <li class="nav-item">
                  <a class="nav-link SmartT" target="_blank" href="https://t.me/smartx_en">Telegram</a>
              </li>
              <!--<li>
              <a class="nav-link SmartA" href="#">Airdrop</a>
              </li>-->
          </ul>
          <div class="description-div card-body">
              <p class="description card-text">SmartX is a decentralized social entertainment platform powered by blockchain technology. By using a blockchain network to resolve the issue of centralization, while ensuring that performance is not bottlenecked by token circulation, SmartX links social entertainment service providers and users around the world and uses social entertainment as a gateway to build a trustworthy and secure social entertainment ecosystem of the future.</p>
          </div>
          <div class="cy-fonts text-center">
              <p class="cy-margin">Tokens eligible for SAT airdrop</p>
          </div>

          <div class="form-in bitRadio">
              <div>
                  <!--checked-->

                  <input class="radiobit" type="radio" name="addrRadio"
                         value="BTC">
                  <label for="blockchain1">BTC</label>

                  <input class="radiobit" type="radio" name="addrRadio"
                         value="ETH">
                  <label for="blockchain2">ETH</label>

                  <input class="radiobit" type="radio" name="addrRadio"
                         value="BNB">
                  <label for="blockchain3">BNB</label>
              </div>
              <div>
                  <input class="radiobit" type="radio" name="addrRadio"
                         value="Xdag">
                  <label for="blockchain1">Xdag</label>

                  <input class="radiobit" type="radio" name="addrRadio"
                         value="Doge">
                  <label for="blockchain2">Doge</label>

                  <input class="radiobit" type="radio" name="addrRadio"
                         value="Ht">
                  <label for="blockchain3">Ht</label>
              </div>
          </div>

          <div class="modal-body" role="alert">
              <p class="card-size text-center"><input id="addressStr" class="card-size text-center" placeholder="Please enter your wallet address" type="text" value="" /></p>
          </div>
          <div class="cy-fonts text-center">
              <p style="margin-top: -5px;">Please enter your wallet address and select a token</p>
          </div>
          
          <div class="cy-fonts text-center">
              <p id="guanfangAddress" style="margin-top: 15px; height:15px;"></p>
          </div>

          <div style="margin-top:22px;" class="cy-fonts text-center">
              <img style="width:200px; height:44px; cursor:pointer;" id="bitImg" src="img/copy-address.jpg" />
          </div>

          <div class="cy-fonts text-center">
              <p style="margin-top:20px; margin-bottom:5px;" class="cy-margin">
                  <!--Click on the button above to copy the address and transfer it to 0.000001 Token for verification.-->
                  In order to verify your wallet address, please click on the button above to copy 
              </p>
              <p style="">the official wallet address and make a minimum transfer of 0.00001 Token</p>
          </div>

          <div class="modal-body" role="alert">
              <p class="card-size text-center">
                  <input id="uid" class="card-size text-center" placeholder="Please enter your PIEXGO UID" type="text" value="" />
                  <img style="width:94px; height:44px; margin-top:30px; cursor:pointer;" id="submit" src="img/submit.jpg" />
              </p>
          </div>

          <div class="cy-fonts text-center">
              <p style="margin-bottom:5px;" class="cy-margin">
                  SAT will be airdropped to your PIEXGO account. If you don't have a                   
              </p>
              <p style="margin-bottom:5px;">PIEXGO account, please register at <a target="_blank" href="https://www.piexgo.com/?invite_code=2HQTJ7&lang=en">www.piexgo.com</a>.</p>
              <p>You can find your UID under Profile.</p>
          </div>

          <footer style="padding-top:50px; padding-bottom:20px;" class="cy-fonts text-center">
              <p>2019 SMARTX</p>
          </footer>

      </div>
   </body>
</html>